package com.runfast.waimai.web.controller.Driver_controller;





import com.runfast.paotui.dao.model.RunfastLoginRecord;
import com.runfast.paotui.dao.model.RunfastShopper;
import com.runfast.paotui.service.RunfastLoginRecordService;
import com.runfast.paotui.service.RunfastShopperService;
import com.runfast.waimai.util.AESUtil;
import com.runfast.waimai.util.Constant;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.annotation.Resource;
@Controller
public class DriverBaseController {
	@Resource
	RunfastLoginRecordService runfastLoginRecordService;
	@Resource
	RunfastShopperService runfastShopperService;
	/**
	 *   获取登录配送员信息
	 * */

	public RunfastShopper getLoginShopper(String token){  //新建的一张表

//		return (RunfastShopper) ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
//				.getRequest().getSession().getAttribute(Constant.APP_DRIVER_SESSION);

		String a="abcdefghijklmn";
		Integer id=Integer.parseInt(AESUtil.decrypt(token,a));

		RunfastShopper runfastShopper=runfastShopperService.get(id);

		return runfastShopper;
	}
	
	
}
